home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / datasheets and manuals / Hardware / WHT / scsi / dsr_sources_2_2001 / isfileopen < prev    next >
Text File  |  2006-10-19  |  2KB  |  58 lines

  1. * Module: ISFILEOPEN
  2. *
  3. * Date: January 16, 1995
  4. *
  5. * Author: David Nieters
  6. *
  7. * Modifications:
  8. *   April 18, 1995 - Changed the size of a file entry to
  9. *                    100 blocks to allow for expansion
  10.  
  11. * IFO - Is File Open
  12. *
  13. * This routine will check to see if the file name specified in
  14. * the name compare buffer has been opened.  The SCSI ID is
  15. * contained in MSB of the caller's R6.  If the file is open,
  16. * it will set the equal bit in the caller's status register.
  17. * It also sets the caller's registers as follows -
  18. *
  19. *    R5 = Pointer to open file cache entry
  20. *
  21. * Note: RAM bank 2 must be enabled before calling this routine
  22. *
  23.  
  24.  
  25. IFO    DATA IFOWS
  26.        DATA IFO1
  27.  
  28. IFO1   LI   R9,>0600     Starting bank of data buffer
  29.        LI   R8,>5000     Starting address of FDRs
  30.        LI   R2,16        Maximum possible number of open files
  31.        LI   R3,OFCASH    Set to beginning of open file cache
  32.  
  33. IFO3   MOV  @4(R3),R0
  34.        JEQ  IFONXT            Go to next file if this one is not open
  35.        CB   *R3,@12(R13)      Comapre SCSI ID
  36.        JNE  IFONXT            Go to next file if SCSI IDs don't match
  37.  
  38.        MOV  R3,R4
  39.        AI   R4,8
  40.        LI   R5,NCB       Point R4 at full file name
  41.        LI   R6,40        Maximum file name length
  42. IFO2   C    *R4+,*R5+
  43.        JNE  IFONXT
  44.        DECT R6
  45.        JNE  IFO2
  46.  
  47.        MOV  R3,@10(R13)       We have a match!
  48.        SOC  @EQBIT,R15        Set equal status bit
  49.        RTWP
  50.  
  51.  
  52. IFONXT
  53.        AI   R3,100            Go to next entry in Open File Cache
  54.        DEC  R2
  55.        JNE  IFO3              Check next entry
  56.        SZC  @EQBIT,R15        Clear equal status bit
  57.        RTWP                   and return
  58.